import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class OrderDetailStatus extends StatefulWidget {
  @override
  _OrderDetailStatusState createState() => _OrderDetailStatusState();
}

class _OrderDetailStatusState extends State<OrderDetailStatus> {
  String currentStatus='待发货';
  List status=[
    '待付款',
    '待发货',
    '待收货',
    '待评价',
    '已完成'
  ];

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 700.w,
      margin: EdgeInsets.only(left: 25.w),
      child: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children:status.map((e){
              return Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Text('${e}',style: TextStyle(
                    color: e==currentStatus?Colors.red:Colors.grey,
                    fontWeight: FontWeight.bold
                  ),),
                  SizedBox(width: 50.w)
                ],
              );
            }).toList(),
          ),
          SizedBox(height: 20.w,),
          Container(
            width: 650.w,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: status.map((e){
                return Row(
                  children: [
                    Container(
                      width: 10.w,
                      height:10.w,
                      decoration: BoxDecoration(
                          borderRadius:BorderRadius.all(Radius.circular(5.w)),
                          color: e==currentStatus?Colors.red:Colors.grey
                      ),
                    ),
                    SizedBox(width: 15.w,),
                    Offstage(
                    offstage:e=='已完成',
                      child: Container(
                        width: 80.w,
                        height:2.w,
                        decoration: BoxDecoration(
                            color: Colors.grey
                        ),
                      ),
                    ),
                    Offstage(
                      offstage:e=='已完成',
                      child:   SizedBox(width: 15.w,),
                    )

                  ],
                );
              }).toList(),
            ),
          )
        ],
      ),
    );
  }
}
